[filters] type meta.value as string or object#253537
Merged
nreese merged 12 commits intoelastic:mainfrom Feb 20, 2026
Merged
Conversation
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
30c8250 to
3ded808
Compare
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
/ci |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
Author
|
/ci |
Contributor
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
nickpeihl
approved these changes
Feb 18, 2026
Contributor
nickpeihl
left a comment
There was a problem hiding this comment.
lgtm! thanks for reviewing and fixing this. code review and tested saving filters with maps app
markov00
approved these changes
Feb 19, 2026
jcger
approved these changes
Feb 19, 2026
Contributor
Author
|
@elasticmachine merge upstream |
lukasolson
approved these changes
Feb 20, 2026
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build Succeeded
Metrics [docs]Page load bundle
History
|
Contributor
|
Starting backport for target branches: 9.3 https://github.com/elastic/kibana/actions/runs/22239325345 |
kibanamachine
added a commit
to kibanamachine/kibana
that referenced
this pull request
Feb 20, 2026
Fixes elastic#253480 `storedFilterMetaSchema.value` schema is too restrictive and needs to be broadened. This PR broadens `storedFilterMetaSchema.value` to any since `storedFilterMetaSchema.value` is a subset of `FilterMetaParams` and to prevent future issues like this. PR also updates `FilterMeta.value` type to more accurately reflect usage. [mapPhrases](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.ts#L32) sets value to `PhraseFilterValue[]` ``` export const mapPhrases = (filter: Filter) => { if (!isPhrasesFilter(filter)) { throw filter; } const { type, key, params } = filter.meta; return { type, key, value: params, params, }; }; ``` [mapRange](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.ts#L54) sets value to `RangeFilterParams` ``` function getParams(filter: RangeFilter) { const isScriptedRange = isScriptedRangeFilter(filter); const key: string = (isScriptedRange ? filter.meta.field : getFirstRangeKey(filter)) || ''; const params: any = isScriptedRange ? get(filter.query, 'script.script.params') : getRangeByKey(filter, key); return { type: FILTERS.RANGE, key, value: params, params }; } export const mapRange = (filter: Filter) => { if (!isMapRangeFilter(filter)) { throw filter; } return getParams(filter); }; ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 64510c0)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Feb 20, 2026
# Backport This will backport the following commits from `main` to `9.3`: - [[filters] type meta.value as string or object (#253537)](#253537) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2026-02-20T20:07:08Z","message":"[filters] type meta.value as string or object (#253537)\n\nFixes https://github.com/elastic/kibana/issues/253480\n\n`storedFilterMetaSchema.value` schema is too restrictive and needs to be\nbroadened. This PR broadens `storedFilterMetaSchema.value` to any since\n`storedFilterMetaSchema.value` is a subset of `FilterMetaParams` and to\nprevent future issues like this.\n\nPR also updates `FilterMeta.value` type to more accurately reflect\nusage.\n\n\n[mapPhrases](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.ts#L32)\nsets value to `PhraseFilterValue[]`\n```\nexport const mapPhrases = (filter: Filter) => {\n if (!isPhrasesFilter(filter)) {\n throw filter;\n }\n\n const { type, key, params } = filter.meta;\n\n return {\n type,\n key,\n value: params,\n params,\n };\n};\n```\n\n\n[mapRange](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.ts#L54)\nsets value to `RangeFilterParams`\n\n```\nfunction getParams(filter: RangeFilter) {\n const isScriptedRange = isScriptedRangeFilter(filter);\n const key: string = (isScriptedRange ? filter.meta.field : getFirstRangeKey(filter)) || '';\n const params: any = isScriptedRange\n ? get(filter.query, 'script.script.params')\n : getRangeByKey(filter, key);\n\n return { type: FILTERS.RANGE, key, value: params, params };\n}\n\nexport const mapRange = (filter: Filter) => {\n if (!isMapRangeFilter(filter)) {\n throw filter;\n }\n\n return getParams(filter);\n};\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"64510c0529ccf2549e36b932a561ec335a1415e7","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","backport:version","v9.4.0","v9.3.1"],"title":"[filters] type meta.value as string or object","number":253537,"url":"https://github.com/elastic/kibana/pull/253537","mergeCommit":{"message":"[filters] type meta.value as string or object (#253537)\n\nFixes https://github.com/elastic/kibana/issues/253480\n\n`storedFilterMetaSchema.value` schema is too restrictive and needs to be\nbroadened. This PR broadens `storedFilterMetaSchema.value` to any since\n`storedFilterMetaSchema.value` is a subset of `FilterMetaParams` and to\nprevent future issues like this.\n\nPR also updates `FilterMeta.value` type to more accurately reflect\nusage.\n\n\n[mapPhrases](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.ts#L32)\nsets value to `PhraseFilterValue[]`\n```\nexport const mapPhrases = (filter: Filter) => {\n if (!isPhrasesFilter(filter)) {\n throw filter;\n }\n\n const { type, key, params } = filter.meta;\n\n return {\n type,\n key,\n value: params,\n params,\n };\n};\n```\n\n\n[mapRange](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.ts#L54)\nsets value to `RangeFilterParams`\n\n```\nfunction getParams(filter: RangeFilter) {\n const isScriptedRange = isScriptedRangeFilter(filter);\n const key: string = (isScriptedRange ? filter.meta.field : getFirstRangeKey(filter)) || '';\n const params: any = isScriptedRange\n ? get(filter.query, 'script.script.params')\n : getRangeByKey(filter, key);\n\n return { type: FILTERS.RANGE, key, value: params, params };\n}\n\nexport const mapRange = (filter: Filter) => {\n if (!isMapRangeFilter(filter)) {\n throw filter;\n }\n\n return getParams(filter);\n};\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"64510c0529ccf2549e36b932a561ec335a1415e7"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/253537","number":253537,"mergeCommit":{"message":"[filters] type meta.value as string or object (#253537)\n\nFixes https://github.com/elastic/kibana/issues/253480\n\n`storedFilterMetaSchema.value` schema is too restrictive and needs to be\nbroadened. This PR broadens `storedFilterMetaSchema.value` to any since\n`storedFilterMetaSchema.value` is a subset of `FilterMetaParams` and to\nprevent future issues like this.\n\nPR also updates `FilterMeta.value` type to more accurately reflect\nusage.\n\n\n[mapPhrases](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_phrases.ts#L32)\nsets value to `PhraseFilterValue[]`\n```\nexport const mapPhrases = (filter: Filter) => {\n if (!isPhrasesFilter(filter)) {\n throw filter;\n }\n\n const { type, key, params } = filter.meta;\n\n return {\n type,\n key,\n value: params,\n params,\n };\n};\n```\n\n\n[mapRange](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/data/public/query/filter_manager/lib/mappers/map_range.ts#L54)\nsets value to `RangeFilterParams`\n\n```\nfunction getParams(filter: RangeFilter) {\n const isScriptedRange = isScriptedRangeFilter(filter);\n const key: string = (isScriptedRange ? filter.meta.field : getFirstRangeKey(filter)) || '';\n const params: any = isScriptedRange\n ? get(filter.query, 'script.script.params')\n : getRangeByKey(filter, key);\n\n return { type: FILTERS.RANGE, key, value: params, params };\n}\n\nexport const mapRange = (filter: Filter) => {\n if (!isMapRangeFilter(filter)) {\n throw filter;\n }\n\n return getParams(filter);\n};\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"64510c0529ccf2549e36b932a561ec335a1415e7"}},{"branch":"9.3","label":"v9.3.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <reese.nathan@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #253480
storedFilterMetaSchema.valueschema is too restrictive and needs to be broadened. This PR broadensstoredFilterMetaSchema.valueto any sincestoredFilterMetaSchema.valueis a subset ofFilterMetaParamsand to prevent future issues like this.PR also updates
FilterMeta.valuetype to more accurately reflect usage.mapPhrases sets value to
PhraseFilterValue[]mapRange sets value to
RangeFilterParams